

const numTo10 = (num) => {
	return num < 10 ? '0' + num.toString() : num
}


export const DateTimeFormatter = (time) => {
	let year = time.getFullYear()
	
	let month = numTo10(time.getMonth() + 1)
	let day = numTo10(time.getDate())
	let hours = numTo10(time.getHours())
	let min = numTo10(time.getMinutes())
	let sec = numTo10(time.getSeconds())
	return year + '-' + month + '-' + day + ' ' + hours + ':' + min + ':' + sec
} 
export const DateFormatter = (time) => {
	let year = time.getFullYear()
	
	let month = numTo10(time.getMonth() + 1)
	let day = numTo10(time.getDate())
	return year + '-' + month + '-' + day
} 
export const YMFormatter = (time) => {
	let year = time.getFullYear()
	let month = numTo10(time.getMonth() + 1)
	return year + month
} 